package com.wza.designPattern.AbstructFactoryPattern;

import com.wza.designPattern.FactoryPattern.Rectangle;
import com.wza.designPattern.FactoryPattern.Square;
import com.wza.designPattern.interfaces.Color;
import com.wza.designPattern.interfaces.Shape;

/**
 * <一句话功能简述>
 * <功能详细描述>
 *
 * @author Administrator
 * @version [版本号, 2018/11/20]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
public class ShapeFactory extends AbstractFactory
{
    @Override
    public Shape getShape(String shapeName)
    {
        if (shapeName == null)
        {
            System.out.println("shapeName is null !");
            return null;
        }

        if ("CIRCLE".equalsIgnoreCase(shapeName))
        {
            return new Circle();
        }
        else if ("RECTANGLE".equalsIgnoreCase(shapeName))
        {
            return new Rectangle();
        }
        else if ("SQUARE".equalsIgnoreCase(shapeName))
        {
            return new Square();
        }
        else
        {
            System.out.println("Unknown Shape!");
        }

        return null;
    }

    @Override
    public Color getColor(String colorName)
    {
        return null;
    }
}
